<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>box-sizeing盒模型</title>
    <style>
      .box1 {
        width: 200px;
        height: 200px;
        background-color: rosybrown;
        padding: 10px;
        border: 10px solid red;
      }

      .box2 {
        /* 往里面压缩，使内容区域变化 */
        box-sizing: border-box;
        width: 100px;
        height: 100px;
        background-color: orange;
        padding: 20px;
        border: 10px solid coral;
      }
    </style>
  </head>
  <body>
    <div class="box1">box1</div>
    <div class="box2">box2</div>
  </body>
</html>
